/**
 * @author Dennis Meyer, Sebastian Brodehl
 *
 */
public class RunAStar {

	public static void main(String[] args) {
		/* The used map: 1 ist a walkable field, 0 indicates an unwalkable field. */
		int [][] map = new int[][]{
                {1,1,1,1,1,1,1,1},
                {1,1,1,1,1,1,1,1},
                {1,1,1,1,1,1,1,1},
                {1,1,0,0,0,0,0,1},
                {1,0,1,1,1,1,1,1},
                {1,1,0,1,1,1,0,1},
                {1,1,1,1,1,1,1,1},
                {1,1,1,1,1,1,1,1}
		};
		
		/* Define start and goal nodes */
		aStarNode start = new aStarNode(3,5);
		aStarNode goal = new aStarNode(2,2);
		
		/*	There are a few heuristic you can use:
		    - 1 Manhattan
			- 2 Euclidean
			- 3 Chebyshev
			
			In this case the manhatten distance seems to be the best, but it depends on the problem size and constraints.
		*/
		long startTime = System.currentTimeMillis();
		/* Compute the path from start to goal */
		AStar aStar = new AStar(map, start, goal, 1);
		/* Measure the milliseconds */
		System.out.println((System.currentTimeMillis() - startTime) + "ms.");
		/* Print the computed path */
		aStar.printPath();		
	}

}

